/*
    * @module:views/budget/investBudget/budgetRelease
    * @author:zengfx
    * @date:2020-12-17
    * 预算下达
*/
<template>
    <div class="budgetRelease_container">
        <el-tabs v-model="activeName" @tab-click="handleClick">
            <el-tab-pane label="预算下达" name="first">
                <tab1 ref="tab1"></tab1>
            </el-tab-pane>
            <el-tab-pane label="调整申请" name="second">
                <tab2 ref="tab2"></tab2>
            </el-tab-pane>
            <el-tab-pane label="累计下达" name="third">
                <tab3 ref="tab3"></tab3>
            </el-tab-pane>
        </el-tabs>
    </div>
</template>

<script>
import { $budgetAPI } from "@/api/";
import { getSessionStorage } from "@/common/js/storage";
import prefixAPI from "@/api/prefixAPI";
import { getCookie } from "@/common/js/cookie";
import tab1 from "./modulation-tab1";
import tab2 from "./modulationList";
import tab3 from "./modulationTotal";
export default {
    name: "budgetRelease",
    components: {
        tab1,
        tab2,
        tab3,
    },
    data() {
        return {
            form: {
                areaId: "",
                year: this.moment().format("YYYY"),
                specialId: "",
            },
            importForm: {
                description: "",
                file: null,
                year: this.moment().format("YYYY"),
                specialId: "",
            },
            yearList: [],
            tableData: [],
            accountInfo: null,
            tableLoading: false,
            titleList: [],
            dialogVisible: false,
            formLabelWidth: "80px",
            fileList: [],
            rules: {
                year: [
                    { required: true, message: "请选择年份", trigger: "blur" },
                ],
                specialId: [
                    {
                        required: true,
                        message: "请选择投资专项",
                        trigger: "blur",
                    },
                ],
                description: [
                    {
                        required: true,
                        message: "请输入下达说明",
                        trigger: "blur",
                    },
                ],
            },
            param: "",
            lvl: "",
            idList: [
                {
                    id: "",
                    specialName: "全部",
                },
            ],
            idList2: [],
            areaName: "",
            activeName: "first",
        };
    },

    mounted() {
        var that = this,
            type = that.$route.query.type;

        that.accountInfo = JSON.parse(getSessionStorage("accountInfo"));
        that.form.areaId = that.accountInfo.areaId;
        that.lvl = that.accountInfo.areaLvl;
        if (type == "change") {
            that.activeName = "first";
        }
        if (type == "modulationList") {
            that.activeName = "second";
        }
        that.$refs.tab1.init();
    },
    methods: {
        handleClick(tab, event) {
            var that = this;
            console.log(tab, event);
            if (tab.name == "first") {
                that.$refs.tab1.init();
            }
            if (tab.name == "second") {
                that.$refs.tab2.init();
            }
            if (tab.name == "third") {
                that.$refs.tab3.init();
            }
        },
    },
};
</script>
<style lang="scss" scoped>
.dialog-footer {
    display: flex;
    justify-content: center;
}
</style>